
public class CheckLevel {
	
	static int CurrentPosY;
	static int CurrentPosX;
	static int PrevPosX;
	static int PrevPosY;
	static int PreviosTile;
	static boolean isMoving = false;
	static int DirX = 0;
	static int DirY = 0;
	
	public static void check(){
		if(isMoving == true){
			//nextTile(CurrentPosX,CurrentPosY,DirX,DirY);
			
			
			
			
			PrevPosX = CurrentPosX;
			PrevPosY = CurrentPosY;

			CurrentPosX += DirX;
			CurrentPosY += DirY;
			
			ChangeTile.setTile(CurrentPosX,CurrentPosY);
			ChangeTile.change(PrevPosX,PrevPosY,1);
			
		}		
	}
	
	public static void nextTile(int x,int y,int dirX,int dirY){
//		ChangeTile.setTile((int)(x + dirX),(int)(y + dirY));
	}
	
	public static void checkPrev(int x, int y,int Pre){
		isMoving = true;
		CurrentPosY = y;
		CurrentPosX = x;
		if(Pre == 4){
			DirX = -1;
			DirY = 0;
		}
		if(Pre == 3){
			DirX = 0;
			DirY = 1;
		}
		if(Pre == 5){
			DirX = 1;
			DirY = 0;
		}
		if(Pre == 2){
			DirX = 0;
			DirY = -1;

		}
	}
	
	public static void change(int x, int y){
		if(!(x == 14)&&!(y ==14)){
			System.out.println("sdfsdfsdfsdf");
	
			Variable.img[x][y] = Variable.tile[6];
			Variable.type[x][y] = 6;
		}
	}
}
